<?php
/**
 * Created by PhpStorm.
 * User: ruma
 * Date: 2019/2/2
 * Time: 12:43
 */

namespace app\admin\controller;


use app\common\controller\AdminBaseController;
use think\Db;

class Webset extends AdminBaseController
{
    //首页
    public function index()
    {
        if (IS_POST){
            //数据编辑
            $data = input('post.');
            foreach ($data as $key => $value){
                Db::table('webset')->where('webset_name','=',$key)->setField('webset_value',$value);
            }
            $this->success('修改成功','index');
        }
        //获取数据
        $data = (new \app\admin\model\Webset())->getAllData();
        $this->assign('data',$data);
        return $this->fetch();
    }

}